<ix-modal-header
  [requiredRoles]="requiredRoles"
  [title]="'Add Snapshot' | translate"
  [loading]="isFormLoading()"
></ix-modal-header>
<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
      <ix-fieldset>
        <ix-select
          formControlName="dataset"
          [label]="helptext.datasetLabel | translate"
          [options]="datasetOptions$"
          [required]="true"
        ></ix-select>

        <ix-input
          formControlName="name"
          [label]="helptext.nameLabel | translate"
          [tooltip]="helptext.nameTooltip | translate"
        ></ix-input>

        <ix-select
          formControlName="naming_schema"
          [label]="helptext.namingSchemaLabel | translate"
          [tooltip]="helptext.namingSchemaTooltip | translate"
          [options]="namingSchemaOptions$"
        ></ix-select>

        <ix-checkbox
          formControlName="recursive"
          [label]="helptext.recursiveLabel | translate"
          [tooltip]="helptext.recursiveTooltip | translate"
        ></ix-checkbox>

        @if (hasVmsInDataset) {
          <ix-checkbox
            formControlName="vmware_sync"
            [label]="'VMWare Sync' | translate"
          ></ix-checkbox>
        }
      </ix-fieldset>

      <ix-form-actions>
        <button
          *ixRequiresRoles="requiredRoles"
          mat-button
          type="submit"
          color="primary"
          ixTest="save"
          [disabled]="form.invalid || isFormLoading()"
        >
          {{ 'Save' | translate }}
        </button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
